//
//  LoginTextField.m
//  JPWords
//
//  Created by 梁淑婷 on 2024/5/25.
//

#import "LoginTextField.h"

@implementation LoginTextField

-(instancetype)init{
    self = [super init];
    if (self) {
        [self createUI];
    }
    return self;
}

-(void)createUI{
    self.borderStyle = UITextBorderStyleNone;
    self.font = JPUIFontPingFangSCRegular(14);
    self.textColor = KFontBlackColor;
    self.tintColor = KThemeColor;
    UIView *line = [[UIView alloc]init];
    line.backgroundColor = UIColorHex(0xE5E5E5);
    [self addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(@0);
        make.height.mas_equalTo(@0.5);
    }];
}

-(void)placeHolderStr:(NSString*)str{
    NSMutableAttributedString *pStr = [[NSMutableAttributedString alloc]initWithString:str];
    [pStr addAttribute:NSForegroundColorAttributeName value:UIColorHex(0xA0A0A0) range:NSMakeRange(0,pStr.length)];
    [pStr addAttribute:NSFontAttributeName value:self.font range:NSMakeRange(0,pStr.length)];
    self.attributedPlaceholder = pStr;
}

@end
